<%@ page language="java" import="java.util.*,java.sql.*,start.fly.test.database.DBConn" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head><title>用户列表页</title>
    <script  src="../js/jquery-2.1.4.js"></script>
  
     <link rel="stylesheet" href="../css/lanrenzhijia.css" media="all">
           <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script>
jQuery(document).ready(function($) {
	$('.theme-login').click(function(){
		$('.theme-popover-mask').fadeIn(100);
		$('.theme-popover').slideDown(200);
	});
	$('.theme-poptit .close').click(function(){
		$('.theme-popover-mask').fadeOut(100);
		$('.theme-popover').slideUp(200);
	});
    
});
$(document).ready(function(){
	$('.user3').click(function(){
		$('#noticeid').attr("value",$(this).attr('id'));
	});
});
</script>
</head>
<body >
<div style="padding-left: 15px;height:auto;width:99%;" >
<h1>安全资料</h1><hr>
<div>
<form action="notice_list_delete.jsp" method="post" >
<table class="table table-bordered">
   
      <% ResultSet rs=null;
      ResultSet rs1=null;
        String username=(String)session.getAttribute("username");
        Statement statement=null;
        try{
        Driver driver=new com.mysql.jdbc.Driver();
        DriverManager.registerDriver(driver);
         Connection connection=DriverManager.getConnection("jdbc:mysql://www.ccjjltx.cn:3307/numbersystem?useUnicode=true&characterEncoding=utf8","root","usbw");
         String sql="select * from user where username=?";  //创建执行语句
         statement=connection.createStatement();
         rs=statement.executeQuery(sql);
         String groupNumber=null;
         while(rs.next())
        { 
        groupNumber=rs.getString("GroupNumber");
        } 
         if(groupNumber.equals("企业会员")){
        	 DBConn conn=new DBConn();
        	 String sql1="select * from enterprise_user where username=?";
				PreparedStatement preparedStatement=(PreparedStatement) conn.getCon().prepareStatement(sql1);
				  preparedStatement.setString(1,username);
				   rs1=preparedStatement.executeQuery();
				   %>
	   <thead>
      <tr>
         <th>真实名称</th>
         <th>邮政编码</th>
         <th>省份</th>
         <th>城市</th>
          <th>公司地址</th>
         <th>公司网站</th>
         <th>企业规模</th>
         <th>注册资本</th>
         <th>开户银行名字</th>
      </tr>
      </thead>    
         <tbody> 
				   <%
				   while(rs1.next()){
					   %>
		                <tr>
		                <td><%=rs.getString("c_name")%></td>
		                <td><%=rs.getString("c_postcode")%></td>
		                <td><%=rs.getString("c_province")%></td>
		                <td><%=rs.getString("c_city")%></td>   
		                <td><%=rs.getString("c_address")%></td>
		                <td><%=rs.getString("c_website")%></td>
		                <td><%=rs.getString("c_size")%></td>
		                <td><%=rs.getString("c_capital")%></td>  
		                 <td><%=rs.getString("c_bankname")%></td>        
		            </tr>
		        <% 
				   }
				   //关闭数据库
				   conn.close();
         }else{
        	 DBConn conn=new DBConn();
        	 String sql1="select * from userinfo where username=?";
				PreparedStatement preparedStatement=(PreparedStatement) conn.getCon().prepareStatement(sql1);
				  preparedStatement.setString(1,username);
				   rs1=preparedStatement.executeQuery();
				   %>
	   <thead>
      <tr>
         <th>真实名称</th>
         <th>性别</th>
         <th>出生日期</th>
         <th>证件类别</th>
          <th>证件号码</th>
         <th>所在省份</th>
         <th>城市</th>
         <th>地址</th>
         <th>邮政编码</th>
      </tr>
      </thead>    
         <tbody> 
				   <%
				   while(rs1.next()){
					   %>
		                <tr>
		                <td><%=rs.getString("uname")%></td>
		                <td><%=rs.getString("sex")%></td>
		                <td><%=rs.getString("birthday")%></td>
		                <td><%=rs.getString("zjlb")%></td>   
		                <td><%=rs.getString("zjhm")%></td>
		                <td><%=rs.getString("szsf")%></td>
		                <td><%=rs.getString("city")%></td>  
		                 <td><%=rs.getString("addr")%></td>     
		                 <td><%=rs.getString("yzbm")%></td>      
		            </tr>
		        <% 
				   }
				   //关闭数据库
				   conn.close(); 
         }
        }catch(Exception e){
        e.printStackTrace();
        }
        %>
             </tbody>
    </table>
</form>
        </div>
    </div>
</body>
</html>
